package com.buydeem.decorator;

/**
 * 装饰模式
 *
 * @author zengchao
 * @date 2022-05-07 10:37:37
 */
public class App {
    public static void main(String[] args) {
        System.out.println("====== 纯牛奶 ======");
        Drinks drinks = new Milk();
        drinks.taste();

        System.out.println("====== 加糖 ======");
        drinks = new SugarDecorator(drinks);
        drinks.taste();

        System.out.println("====== 加糖和咖啡 ======");
        drinks = new CoffeeDecorator(drinks);
        drinks.taste();

        System.out.println("====== 加糖、咖啡、果汁 ======");
        drinks = new JuiceDecorator(drinks);
        drinks.taste();

    }
}
